<%@include file="/WEB-INF/pages/commons/commons.jsp" %>

<stripes:layout-definition>
    <stripes:layout-render name="/mainLayout.jsp" _title="${_title}" _mainTitle="${_mainTitle}" _subTitle="${_subTitle}">

        <stripes:layout-component name="_head">${_head}</stripes:layout-component>


        <stripes:layout-component name="_leftHandSideGlobalMenu">
            <jsecurity:authenticated>
            <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.administration.UserManagementActionBean" event="view">
                        User Management
                    </stripes:link>
            </li>        
            <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="view">
                        Blog Management
                    </stripes:link>
            </li>
            </jsecurity:authenticated>
        </stripes:layout-component>


        <stripes:layout-component name="_searchInGlobalMenu">
            ${_searchInGlobalMenu}
        </stripes:layout-component>


        <stripes:layout-component name="_rightHandSideGlobalMenu">
            <jsecurity:notAuthenticated>
                <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.general.LoginActionBean" event="view">login</stripes:link>
                </li>
                <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.general.RegisterActionBean" event="view">register</stripes:link>
                </li>
            </jsecurity:notAuthenticated>
            <jsecurity:authenticated>
                <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.general.LogoutActionBean" event="view">logout</stripes:link>
                </li>
                <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.registered.ProfileActionBean" event="view">profile</stripes:link>
                </li>
            </jsecurity:authenticated>
        </stripes:layout-component>

        <stripes:layout-component name="_content">
            ${_content}
        </stripes:layout-component>


        <stripes:layout-component name="_siteLogo">
            ${_siteLogo}
        </stripes:layout-component>


        <stripes:layout-component name="_contentFooter">
            ${_contentFooter}
        </stripes:layout-component>


        <stripes:layout-component name="_sideBox">
        <div class="sidebarBodyHead">
            <div class="menu-tr">
                <div class="menu-tl">
                    <h3>Latest blogs</h3>
                </div>
            </div>
        </div>
        <div class="sidebarBody">
            <ul>
            <c:forEach items="${actionBean.latestBlogs}" var="currentBlog" varStatus="status">
                <li>
                    <stripes:link beanclass="foo.bar.blog.web.action.general.BlogActionBean" event="view">
                        <stripes:param name="blog" value="${currentBlog.id}"/>
                        <c:out value="${currentBlog.name}"/>
                    </stripes:link>
                </li>
            </c:forEach>
            </ul>
            <br/>
        </div>
        </stripes:layout-component>


        <stripes:layout-component name="_footer">
            <stripes:link beanclass="foo.bar.blog.web.action.general.MainFeedsActionBean" event="view">
                <stripes:param name="feedType" value="rss_2_0"/>
                RSS 2.0
            </stripes:link>|
            <stripes:link beanclass="foo.bar.blog.web.action.general.MainFeedsActionBean" event="view">
                <stripes:param name="feedType" value="atom_1_0"/>
                ATOM 1.0
            </stripes:link>|
            Powered by <a href="http://code.google.com/p/foobarblog/">
                FooBarBlog</a> |
            <a href="http://code.google.com/p/foobarblog/issues/list">
                Report an Issue</a> |
            <a href="http://code.google.com/p/foobarblog/wiki/FooBarBlog">
                User Guide</a>
            <br/>
            <br/>
            Released under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>
        </stripes:layout-component>


    </stripes:layout-render>
</stripes:layout-definition>
